deploy: Delete .updated file from /etc and /var on new deployments
authorDan Nicholson <nicholson@endlessm.com>
Sat, 25 Jul 2015 16:51:14 +0000 (09:51 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 18 Jun 2018 13:21:52 +0000 (13:21 +0000)
commitce58307757c9e42b2d949d1566038174bccd4fe1
treec22c4d4fdb834038d932bb68cbdcaa0ee9f9b088
parent7dc3e45b3a2a0946182159121d2d3b7d7b938697
deploy: Delete .updated file from /etc and /var on new deployments

Systemd units using ConditionNeedsUpdate run if the mtime of .updated in
the specified directory is newer than /usr. Since /usr has an mtime of
0, there's no way to have an older .updated file. Systemd units
typically specify ConditionNeedsUpdate=/etc or ConditionNeedsUpdate=/var
to support stateless systems like ostree.

Remove the file from the new deployment's /etc and the OS's /var
regardless of where they came from to ensure that these systemd units
run when booting new deployments. This will provide a method to run
services only on upgrade.

Closes: #1628
https://bugzilla.gnome.org/show_bug.cgi?id=752950

Closes: #1631
Approved by: cgwalters
Makefile-tests.am
src/libostree/ostree-sysroot-deploy.c
tests/test-admin-upgrade-systemd-update.sh [new file with mode: 0755]